package love.xiaohh.datasource.services.impl;

import love.xiaohh.datasource.entities.user.User;
import love.xiaohh.datasource.mapper.user.UserMapper;
import love.xiaohh.datasource.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户的业务处理接口实现
 * </p>
 *
 * @author XiaoHH
 * @version 1.0
 * @date 2021-12-04 星期六 15:24:08
 * @file UserServiceImpl.java
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 新增一个用户
     *
     * @param user 用户对象
     * @return 受影响行数
     */
    @Override
    public int insertUser(User user) {
        return this.userMapper.insertUser(user);
    }

    /**
     * 查询用户列表
     *
     * @param user 查询参数
     * @return 符合条件的用户列表
     */
    @Override
    public List<User> selectUser(User user) {
        return this.userMapper.selectUser(user);
    }
}
